package cmcc.gz.cgt.bean;

import cmcc.gz.cgt.generator.StringUtil;

/**
 * 列信息实体
 * @ClassName: ColumnBean 
 * @author AndrewWen
 * @date 2013-1-14 下午5:01:03
 */
public class ColumnBean {
	
	/**
	 * 数据库中列名称
	 */
	private String columnName;
	
	/**
	 * 生成实体字段名称
	 */
	private String domainColumnName;
	/**
	 * 生成实体字段类型
	 */
	private String domainColumnType;
	/**
	 * get方法
	 */
	private String domainGetMethod;
	/**
	 * set方法
	 */
	private String domainSetMethod;
	


	/**
	 * 列数据类型
	 */
	private int columnType;
	
	/**
	 * 列中文注释
	 */
	private String columnComment;
	/**
	 * 列注释详细
	 */
	private String columnCommentDetail;
	
	/**
	 * 是否主键
	 */
	private boolean isPrimary=false;
	/**
	 * 是否自动递增
	 */
	private boolean isAutoIncrement=false;
	/**
	 * 是否允许空
	 */
	private boolean isNullAble=false;

	/**
	 * 是否是外键
	 */
	private boolean isForeignKey=false;

	public boolean isForeignKey() {
		return isForeignKey;
	}

	public void setForeignKey(boolean isForeignKey) {
		this.isForeignKey = isForeignKey;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public int getColumnType() {
		return columnType;
	}

	public void setColumnType(int columnType) {
		this.columnType = columnType;
	}

	public String getColumnComment() {
		return columnComment;
	}

	public void setColumnComment(String columnComment) {
		this.columnComment = columnComment;
	}

	public boolean isPrimary() {
		return isPrimary;
	}

	public void setPrimary(boolean isPrimary) {
		this.isPrimary = isPrimary;
	}

	public boolean isAutoIncrement() {
		return isAutoIncrement;
	}

	public void setAutoIncrement(boolean isAutoIncrement) {
		this.isAutoIncrement = isAutoIncrement;
	}

	public boolean isNullAble() {
		return isNullAble;
	}

	public void setNullAble(boolean isNullAble) {
		this.isNullAble = isNullAble;
	}
	
	


	public String getDomainColumnName() {
		this.domainColumnName=StringUtil.getClassLower(StringUtil.getDomainColumnName(this.columnName));
		return domainColumnName;
	}

	public void setDomainColumnName(String domainColumnName) {
		this.domainColumnName = domainColumnName;
	}

	public String getDomainColumnType() {
		
		this.domainColumnType=StringUtil.getColumnType(this.columnType);
		
		return domainColumnType;
	}

	public void setDomainColumnType(String domainColumnType) {
		this.domainColumnType = domainColumnType;
	}
	

	public String getDomainGetMethod() {
		this.domainGetMethod=StringUtil.getGetMethod(this.domainColumnName);
		return domainGetMethod;
	}

	public void setDomainGetMethod(String domainGetMethod) {
		this.domainGetMethod = domainGetMethod;
	}

	public String getDomainSetMethod() {
		this.domainSetMethod=StringUtil.getSetMethod(this.domainColumnName);
		return domainSetMethod;
	}

	public void setDomainSetMethod(String domainSetMethod) {
		this.domainSetMethod = domainSetMethod;
	}
	

	public String getColumnCommentDetail() {
		return columnCommentDetail;
	}

	public void setColumnCommentDetail(String columnCommentDetail) {
		this.columnCommentDetail = columnCommentDetail;
	}


}
